package com.yf1706.bean;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.yf1706.tools.UserTools;

import java.util.Date;
import java.util.List;


/**
 * The persistent class for the emp database table.
 * 
 */
@Entity
@NamedQuery(name="Emp.findAll", query="SELECT e FROM Emp e")
public class Emp implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="emp_id")
	private int empId;

	@Column(name="emp_num")

	private String empNum;


	@Column(name="emp_name")
	private String empName;

	@Column(name="english_name")
	private String englishName;

	@Temporal(TemporalType.DATE)
	@Column(name="make_time")
	@JSONField(format="yyyy-MM-dd")
	private Date makeTime;

	private String maker;

	private String password;

	private String photo;
	
	@OneToOne(mappedBy="emp")
	private User user;
	
	//bi-directional many-to-one association to PostSetting
	@ManyToOne
	@JoinColumn(name="post_id")
	private PostSetting postSetting;

	//bi-directional many-to-one association to RankSetting
	@ManyToOne
	@JoinColumn(name="rank_id")
	private RankSetting rankSetting;

	@Column(name="update_emp")
	private String updateEmp;

	@Temporal(TemporalType.DATE)
	@JSONField(format="yyyy-MM-dd")
	@Column(name="update_time")
	private Date updateTime;

	@Column(name="work_status_id")
	private byte workStatusId;

	//bi-directional many-to-one association to Dep
	@ManyToOne
	@JoinColumn(name="dep_id")
	private Dep dep;

	//bi-directional many-to-one association to EmpAttachment
	@OneToMany(mappedBy="emp")
	private List<EmpAttachment> empAttachments;

	//bi-directional one-to-one association to EmpCommunicationInfo
	@OneToOne(mappedBy="emp")
	private EmpCommunicationInfo empCommunicationInfo;

	//bi-directional one-to-one association to EmpDetailInfo
	@OneToOne(mappedBy="emp")
	private EmpDetailInfo empDetailInfo;
	
	//bi-directional one-to-one association to EmpEducationHistory
	@OneToMany(mappedBy="emp")
	private List<EmpEducationHistory> empEducationHistories;

	//bi-directional one-to-one association to EmpFamilyInfo
	@OneToMany(mappedBy="emp")
	private List<EmpFamilyInfo> empFamilyInfos;

	//bi-directional one-to-one association to EmpSkillCertificate
	@OneToMany(mappedBy="emp")
	private List<EmpSkillCertificate> empSkillCertificates;

	//bi-directional many-to-one association to EmpWorkHistory
	@OneToMany(mappedBy="emp")
	private List<EmpWorkHistory> empWorkHistories;

	/*霍关联关系手动添加开始*/
	//关联考勤异常表
	@OneToMany(mappedBy="emp")
	@JSONField(serialize = false)
	private List<CheckException> checkException;
	
	//关联考勤详情表
	@OneToMany(mappedBy="emp")
	@JSONField(serialize = false)
	private List<CheckDetail> checkDetail;
	
	//关联考勤配卡表
	@OneToOne(mappedBy="emp")
	@JSONField(serialize = false)
	private CheckWithcard checkWithCard;
	
	//关联事务申请表
	@OneToMany(mappedBy="emp")
	@JSONField(serialize = false)
	private List<CheckAffairApply> checkAffairApply;

	//关联日考勤汇总表
	@OneToMany(mappedBy="emp")
	@JSONField(serialize = false)
	private List<CheckDate> checkDate;
	
	//关联每月事假汇总表
	@OneToMany(mappedBy="emp")
	@JSONField(serialize = false)
	private List<CheckMonthHoliday> checkMonthHoliday;
	

	//关联每月考勤汇总报告表
	@OneToMany(mappedBy="emp")
	@JSONField(serialize = false)
	private List<CheckMonthReport> checkMonthReport;

	//关联每月每日考勤汇总表
	@OneToMany(mappedBy="emp")
	@JSONField(serialize = false)
	private List<CheckMonthDate> checkMonthDate;
	//关联每月每日考勤汇总表
	@OneToMany(mappedBy="emp")
	@JSONField(serialize = false)
	private List<CheckMonthDetail> checkMonthDetail;

	/*霍关联关系结束*/
	
	/*djt Begin*/
	
	//bi-directional one-to-one association to baseSalary
	@OneToOne(mappedBy="emp")
	@JSONField(serialize = false)
	private BaseSalary baseSalary;
	
	//bi-directional one-to-many association to salaryDetail
	@OneToMany(mappedBy="emp")
	@JSONField(serialize = false)
	private List<SalaryDetail> salaryDetail;
	
	//bi-directional one-to-one association to socialSecurity
	@OneToOne(mappedBy="emp")
	@JSONField(serialize = false)
	private SocialSecurity socialSecurity;
		
	//bi-directional one-to-many association to floatSalary
	@OneToMany(mappedBy="emp")
	@JSONField(serialize = false)
	private List<FloatSalary> floatSalary;
		
	/*djt End*/
	
	public Emp() {
	}

	@Override
	public String toString() {
		return "Emp [empId=" + empId + ", empNum=" + empNum + ", empName=" + empName + ", englishName=" + englishName
				+ ", makeTime=" + makeTime + ", maker=" + maker + ", password=" + password + ", photo=" + photo
				+ ", postSetting=" + postSetting + ", rankSetting=" + rankSetting + ", updateEmp=" + updateEmp
				+ ", updateTime=" + updateTime + ", workStatusId=" + workStatusId + ", dep=" + dep + ", empAttachments="
				+ empAttachments + ", empCommunicationInfo=" + empCommunicationInfo + ", empDetailInfo=" + empDetailInfo
				+ ", empEducationHistories=" + empEducationHistories + ", empFamilyInfos=" + empFamilyInfos
				+ ", empSkillCertificates=" + empSkillCertificates + ", empWorkHistories=" + empWorkHistories
				+ ", checkException=" + checkException + ", checkDetail=" + checkDetail + ", checkWithCard="
				+ checkWithCard + ", checkAffairApply=" + checkAffairApply + ", checkDate=" + checkDate
				+ ", checkMonthHoliday=" + checkMonthHoliday + ", checkMonthReport=" + checkMonthReport
				+ ", checkMonthDate=" + checkMonthDate + ", checkMonthDetail=" + checkMonthDetail + "]";
	}

	public int getEmpId() {
		return this.empId;
	}

	public void setEmpId(int empId) {
		this.empNum=UserTools.userIdFormat(empId);
		this.empId = empId;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getEmpName() {
		return this.empName;
	}

	public void setEmpName(String empName) {
		this.empName = empName;
	}

	public String getEnglishName() {
		return this.englishName;
	}

	public void setEnglishName(String englishName) {
		this.englishName = englishName;
	}

	public Date getMakeTime() {
		return this.makeTime;
	}

	public void setMakeTime(Date makeTime) {
		this.makeTime = makeTime;
	}

	public String getMaker() {
		return this.maker;
	}

	public void setMaker(String maker) {
		this.maker = maker;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPhoto() {
		return this.photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}


	public PostSetting getPostSetting() {
		return postSetting;
	}

	public void setPostSetting(PostSetting postSetting) {
		this.postSetting = postSetting;
	}

	public RankSetting getRankSetting() {
		return rankSetting;
	}

	public void setRankSetting(RankSetting rankSetting) {
		this.rankSetting = rankSetting;
	}

	public List<EmpEducationHistory> getEmpEducationHistories() {
		return empEducationHistories;
	}

	public void setEmpEducationHistories(List<EmpEducationHistory> empEducationHistories) {
		this.empEducationHistories = empEducationHistories;
	}

	public List<EmpFamilyInfo> getEmpFamilyInfos() {
		return empFamilyInfos;
	}

	public void setEmpFamilyInfos(List<EmpFamilyInfo> empFamilyInfos) {
		this.empFamilyInfos = empFamilyInfos;
	}

	public List<EmpSkillCertificate> getEmpSkillCertificates() {
		return empSkillCertificates;
	}

	public void setEmpSkillCertificates(List<EmpSkillCertificate> empSkillCertificates) {
		this.empSkillCertificates = empSkillCertificates;
	}

	public String getUpdateEmp() {
		return this.updateEmp;
	}

	public void setUpdateEmp(String updateEmp) {
		this.updateEmp = updateEmp;
	}

	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public byte getWorkStatusId() {
		return this.workStatusId;
	}

	public void setWorkStatusId(byte workStatusId) {
		this.workStatusId = workStatusId;
	}

	public Dep getDep() {
		return this.dep;
	}

	public void setDep(Dep dep) {
		this.dep = dep;
	}

	public String getEmpNum() {
		return empNum;
	}

	public void setEmpNum(String empNum) {
		this.empNum = empNum;
	}
	public List<EmpAttachment> getEmpAttachments() {
		return this.empAttachments;
	}

	public void setEmpAttachments(List<EmpAttachment> empAttachments) {
		this.empAttachments = empAttachments;
	}

	public EmpAttachment addEmpAttachment(EmpAttachment empAttachment) {
		getEmpAttachments().add(empAttachment);
		empAttachment.setEmp(this);

		return empAttachment;
	}

	public EmpAttachment removeEmpAttachment(EmpAttachment empAttachment) {
		getEmpAttachments().remove(empAttachment);
		empAttachment.setEmp(null);

		return empAttachment;
	}

	public EmpCommunicationInfo getEmpCommunicationInfo() {
		return this.empCommunicationInfo;
	}

	public void setEmpCommunicationInfo(EmpCommunicationInfo empCommunicationInfo) {
		this.empCommunicationInfo = empCommunicationInfo;
	}

	public EmpDetailInfo getEmpDetailInfo() {
		return this.empDetailInfo;
	}

	public void setEmpDetailInfo(EmpDetailInfo empDetailInfo) {
		this.empDetailInfo = empDetailInfo;
	}

	public List<EmpWorkHistory> getEmpWorkHistories() {
		return this.empWorkHistories;
	}

	public void setEmpWorkHistories(List<EmpWorkHistory> empWorkHistories) {
		this.empWorkHistories = empWorkHistories;
	}
	
	/*霍set方法开始*/
	public List<CheckException> getCheckException() {
		return checkException;
	}

	public void setCheckException(List<CheckException> checkException) {
		this.checkException = checkException;
	}
	public List<CheckDetail> getCheckDetail() {
		return checkDetail;
	}

	public void setCheckDetail(List<CheckDetail> checkDetail) {
		this.checkDetail = checkDetail;
	}
	public CheckWithcard getCheckWithCard() {
		return checkWithCard;
	}

	public void setCheckWithCard(CheckWithcard checkWithCard) {
		this.checkWithCard = checkWithCard;
	}
	
	public List<CheckAffairApply> getCheckAffairApply() {
		return checkAffairApply;
	}

	public void setCheckAffairApply(List<CheckAffairApply> checkAffairApply) {
		this.checkAffairApply = checkAffairApply;
	}
	
	public List<CheckDate> getCheckDate() {
		return checkDate;
	}

	public void setCheckDate(List<CheckDate> checkDate) {
		this.checkDate = checkDate;
	}
	
	public List<CheckMonthHoliday> getCheckMonthHoliday() {
		return checkMonthHoliday;
	}

	public void setCheckMonthHoliday(List<CheckMonthHoliday> checkMonthHoliday) {
		this.checkMonthHoliday = checkMonthHoliday;
	}
	
	public List<CheckMonthReport> getCheckMonthReport() {
		return checkMonthReport;
	}

	public void setCheckMonthReport(List<CheckMonthReport> checkMonthReport) {
		this.checkMonthReport = checkMonthReport;
	}
	
	public List<CheckMonthDate> getCheckMonthDate() {
		return checkMonthDate;
	}

	public void setCheckMonthDate(List<CheckMonthDate> checkMonthDate) {
		this.checkMonthDate = checkMonthDate;
	}
 

	public List<CheckMonthDetail> getCheckMonthDetail() {
		return checkMonthDetail;
	}

	public void setCheckMonthDetail(List<CheckMonthDetail> checkMonthDetail) {
		this.checkMonthDetail = checkMonthDetail;
	}

	/*霍 set方法结束*/
	
	/*djt set&get begin*/
	
	public BaseSalary getBaseSalary() {
		return baseSalary;
	}

	public void setBaseSalary(BaseSalary baseSalary) {
		this.baseSalary = baseSalary;
	}

	public List<SalaryDetail> getSalaryDetail() {
		return salaryDetail;
	}

	public void setSalaryDetail(List<SalaryDetail> salaryDetail) {
		this.salaryDetail = salaryDetail;
	}

	public SocialSecurity getSocialSecurity() {
		return socialSecurity;
	}

	public void setSocialSecurity(SocialSecurity socialSecurity) {
		this.socialSecurity = socialSecurity;
	}

	public List<FloatSalary> getFloatSalary() {
		return floatSalary;
	}

	public void setFloatSalary(List<FloatSalary> floatSalary) {
		this.floatSalary = floatSalary;
	}
	
	/*djt set&get end*/

	
}